/** for Color */
import java.awt.Color;

/**
 * HW 12b & 13b, "SquarePiece"<br><br>
 * 
 * This class is represents the SquarePiece for the Piece object
 * 
 * @author Hyun Seo Chung
 * @version 1.0 04/21/12
 */
public class SquarePiece extends Piece {

	/**
	 * serialVersionUID for the SquarePiece class
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * first shape
	 */
	private static final int[][] SHAPE = 
			new int[][] {{0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};

	/**
	 * This is a constructor that takes in a x and y position of the piece to be placed, 
	 * and sets it up (plus the corresponding color 
	 * and the default shape) by calling the super constructor. 
	 * 
	 * @param x The column number of the tile to be checked
	 * @param y The row number of the tile to be checked
	 */
	public SquarePiece(int x, int y) {
		super(x, y, Color.YELLOW, SHAPE);
	}
	
	/**
	 * This method checks and rotates the piece to the next shape.
	 * 
	 * @return true if it was able (allowed) to rotate, false otherwise
	 */
	@Override
	public boolean canRotate() {
		// squares would be the same after rotating
		return true;
	}

	/** 
	 * This is a tostring method.
	 * @return tostring.
	 */
	@Override
	public String toString() {
		return super.toString();
	}
}
